package com.nfdw.project.web;


import com.nfdw.project.core.Result;
import com.nfdw.project.core.ResultGenerator;
import com.nfdw.project.dto.RetailUserTradeSettleInfoDto;
import com.nfdw.project.dto.WholesaleUserTradeSettleInfoDto;
import com.nfdw.project.model.RetailUserTradeSettleInfo;
import com.nfdw.project.service.RetailUserTradeSettleInfoService;
import com.nfdw.project.service.WholesaleUserTradeSettleInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 用户交易结算情况controller
 */
@RestController
@RequestMapping("/api/trade/settle/info")
public class TradeSettleInfoController {

    @Autowired
    private RetailUserTradeSettleInfoService retailUserTradeSettleInfoService;
    @Autowired
    private WholesaleUserTradeSettleInfoService wholesaleUserTradeSettleInfoService;


    @PostMapping("/retail/user/info")
    public Result tradeSettleRetailUserInfo(RetailUserTradeSettleInfoDto param){

        return ResultGenerator.genSuccessResult(retailUserTradeSettleInfoService.tradeSettleInfo(param));
    }

    @PostMapping("/retail/user/analysis")
    public Result tradeSettleRetailUserAnalysis(RetailUserTradeSettleInfoDto param){

        return ResultGenerator.genSuccessResult(retailUserTradeSettleInfoService.tradeSettleAnalysis(param));
    }

    @PostMapping("/wholesale/user/info")
    public Result tradeSettleWholesaleUserInfo(WholesaleUserTradeSettleInfoDto param){

        return ResultGenerator.genSuccessResult(wholesaleUserTradeSettleInfoService.tradeSettleInfo(param));
    }

    @PostMapping("/wholesale/user/analysis")
    public Result tradeSettleWholesaleUserAnalysis(WholesaleUserTradeSettleInfoDto param){

        return ResultGenerator.genSuccessResult(wholesaleUserTradeSettleInfoService.tradeSettleAnalysis(param));
    }



}
